#
# Copyright (c) 2013 Qualcomm Atheros, Inc.
# Copyright (C) 2006-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=ncurses
PKG_VERSION:=6.2
PKG_RELEASE:=

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://invisible-mirror.net/archives/ncurses/ncurses-6.2.tar.gz
PKG_MD5SUM:=

include $(INCLUDE_DIR)/package.mk

define Package/ncurses
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=Command lines edition library
endef

define Package/ncurses/description
endef

define Build/Configure
	$(call Build/Configure/Default, \
		--disable-stripping  --disable-tcap-names \
		--without-tests --disable-database \
		--disable-termcap --without-fallbacks \
		--with-shared \
	)
endef

TARGET_CPPFLAGS:=-I. -I.. $(TARGET_CPPFLAGS)

TARGET_CFLAGS += $(FPIC)

define Build/Compile
	$(MAKE) -C $(PKG_BUILD_DIR) \
		DESTDIR="$(PKG_INSTALL_DIR)" \
		all install
endef

define Build/InstallDev
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
endef

define Package/ncurses/install
endef

$(eval $(call BuildPackage,ncurses))
